#pragma once

#include "McuRPCBuffer.h"
#include "BufferQueue.h"
#include <utils/Thread.h>

namespace android {

class McuRPCManager;

class ReaderThread: public Thread {
public:
    ReaderThread(McuRPCManager* manager, int hw_type, BufferQueue<McuRPCBuffer>* queue);
    ~ReaderThread();
    void start();
    void stop();

private:
    virtual bool threadLoop() override;
    int openDevice();
    int mFd;

    int recvMsg(McuRPCBuffer* buf);


    McuRPCManager* mManager;
    BufferQueue<McuRPCBuffer>* mBufferQueue;
    int mHwType;

    int mTestCount;
};

} //namespace
